import { bannerList } from '../../../request/api';
const state = {
    bannerlist: [],//轮播图列表
}

const mutations = {
    CHANGE_BANNER(state, payload) {
        state.bannerlist = payload;
    }
}

const actions = {
    getBannerlistAction({ commit }) {
        bannerList().then(res => {
            if (res.code == 200) {
                console.log(res);
                commit('CHANGE_BANNER', res.list)
            }
        })
    }
}

const getters = {
    getBannerList(state) {
        return state.bannerlist
    }
}

export default {
    state, mutations, actions, getters, namespaced: true
}